package com.whf.android.jar.util;

import com.whf.android.jar.app.Latte;
import com.whf.android.jar.util.log.LatteLogger;

/**
 * 判断工具
 *
 * @author 博为峰
 * @date 2017.12.05 19:07
 */
public class JudgeUtil {

    /**
     * 判断是否能呀
     *
     * @param length:需要的最小长度
     * @param string:判断的变量
     */
    public static boolean lengthJudge(int length, String... string) {
        boolean isLength = false;
        if (string.length >= length) {
            isLength = true;
        }
        return isLength;
    }

    /**
     * 判断是否能呀
     *
     * @param length:需要的最小长度
     * @param string:判断的变量
     */
    public static boolean lengthJudge(int length, String string) {
        boolean isLength = false;
        if (string.length() >= length) {
            isLength = true;
        }
        return isLength;
    }


    /**
     * 判断是否更新
     *
     * @param versions:服务器版本
     */
    public static boolean versionsJudge(int versions) {
        boolean isLength = false;
        LatteLogger.i("服务器版本>>" + versions + ";本地版本" + Latte.getVersionCode());
        if (versions > Latte.getVersionCode()) {
            isLength = true;
        }
        return isLength;
    }
}
